:root {
  /* 浅色模式配色 */
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --bg-color: #ffffff;
  --chat-bg: #ffffff;
  --header-bg: #ffffff;
  --text-color: #111827;
  --text-secondary: #6b7280;
  --border-color: #e5e7eb;
  --message-user-bg: #e9f1ff;
  --input-bg: #ffffff;
  --code-bg: #f3f4f6;
  --button-bg: #f9fafb;
  --button-hover: #f3f4f6;
  --loading-dot-bg: #94a3b8;
  --shadow-color: rgba(0, 0, 0, 0.1);
  --scrollbar-track: #f1f1f1;
  --scrollbar-thumb: #c1c1c1;
}

.dark-mode {
  /* 深色模式配色 */
  --primary-color: #3b82f6;
  --primary-hover: #2563eb;
  --bg-color: #1e1e1e;
  --chat-bg: #1e1e1e;
  --header-bg: #1e1e1e;
  --text-color: #f9fafb;
  --text-secondary: #9ca3af;
  --border-color: #374151;
  --message-user-bg: #343541;
  --input-bg: #2d2d2d;
  --code-bg: #2d2d2d;
  --button-bg: #2d2d2d;
  --button-hover: #383838;
  --loading-dot-bg: #6b7280;
  --shadow-color: rgba(0, 0, 0, 0.5);
  --scrollbar-track: #2d2d2d;
  --scrollbar-thumb: #4d4d4d;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-color);
  background-color: var(--bg-color);
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}

/* 自定义滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100%;
  position: relative;
}

/* 头部样式 */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background-color: var(--header-bg);
  width: 100%;
  z-index: 50;
  position: fixed;
  top: 0;
  left: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.app-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-color);
  margin: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.theme-toggle-button {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle-button:hover {
  background-color: var(--button-hover);
}

.github-link {
  color: var(--text-secondary);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 8px;
}

.github-link:hover {
  background-color: var(--button-hover);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #ef4444;
}

.status-dot.connected {
  background-color: #10b981;
}

/* 主内容区域样式 */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  width: 100%;
  transition: padding-bottom 0.2s ease;
  margin-top: 64px;
}

.chat-container {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  max-width: 768px;
  margin: 0 auto;
  box-sizing: border-box;
}

/* 消息样式 */
.message {
  display: flex;
  flex-direction: column;
  width: 100%;
  position: relative;
  animation: fadeIn 0.3s ease forwards;
  word-break: break-word;
  padding: 8px 0;
}

/* 系统消息样式 */
.system-message .message-content {
  background-color: var(--button-bg);
  padding: 12px 16px;
  border-radius: 8px;
  margin: 0 auto;
  max-width: 85%;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* 用户消息样式 */
.user-message {
  align-self: flex-end;
  margin-left: auto;
  margin-right: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.user-message .message-content {
  align-self: flex-end;
  background-color: var(--message-user-bg);
  color: var(--text-color);
  padding: 10px 14px;
  border-radius: 8px;
  max-width: 100%;
  margin-left: auto;
}

.user-message .action-buttons {
  margin-top: 4px;
}

/* 助手消息样式 */
.assistant-message {
  align-self: flex-start;
  margin-right: auto;
  margin-left: 0;
}

.assistant-message .message-content {
  background-color: transparent;
  color: var(--text-color);
  padding: 0;
  max-width: 100%;
}

/* 消息内容样式 */
.message-content {
  line-height: 1.6;
  overflow-x: auto;
  max-width: 100%;
}

/* 消息内容内部元素样式 */
.message-content p {
  margin-bottom: 12px;
}

.message-content p:last-child {
  margin-bottom: 0;
}

/* 代码块样式 */
.message-content pre {
  background-color: var(--code-bg);
  border-radius: 8px;
  padding: 12px;
  overflow-x: auto;
  margin: 12px 0;
  position: relative;
  max-width: 100%;
  white-space: pre-wrap;
}

.message-content pre code {
  font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
  font-size: 0.875rem;
  line-height: 1.5;
}

.message-content code:not(pre code) {
  background-color: var(--code-bg);
  border-radius: 4px;
  padding: 2px 4px;
  font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
  font-size: 0.875em;
}

/* Markdown 样式增强 */
.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4,
.message-content h5,
.message-content h6 {
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  font-weight: 600;
  line-height: 1.25;
}

.message-content h1 {
  font-size: 1.5em;
}

.message-content h2 {
  font-size: 1.25em;
}

.message-content h3 {
  font-size: 1.125em;
}

.message-content ul, 
.message-content ol {
  padding-left: 1.5em;
  margin: 0.5em 0;
}

.message-content li {
  margin: 0.25em 0;
}

.message-content blockquote {
  padding-left: 1em;
  border-left: 4px solid var(--border-color);
  color: var(--text-secondary);
  margin: 1em 0;
}

.message-content a {
  color: var(--primary-color);
  text-decoration: none;
}

.message-content a:hover {
  text-decoration: underline;
}

.message-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 1em 0;
}

.message-content table, 
.message-content th, 
message-content td {
  border: 1px solid var(--border-color);
}

.message-content th, 
.message-content td {
  padding: 8px;
  text-align: left;
}

/* 按钮栏样式 */
.action-buttons {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.action-button {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 6px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.action-button:hover {
  background-color: var(--button-hover);
}

.action-buttons .btn {
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  font-size: 14px;
}

.action-buttons .btn-primary {
  background: var(--primary-color);
  color: white;
}

.action-buttons .btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.action-buttons .btn-secondary {
  background: var(--button-bg);
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

.action-buttons .btn-secondary:hover {
  background: var(--button-hover);
  transform: translateY(-1px);
}

/* 输入区域样式 - 固定在底部 */
.input-wrapper {
  width: 100%;
  max-width: 768px;
  margin: 0 auto;
  padding: 24px 16px;
  box-sizing: border-box;
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--bg-color);
  z-index: 5;
}

.input-container {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background-color: var(--input-bg);
  box-shadow: 0 2px 6px var(--shadow-color);
  transition: border-color 0.2s ease;
  overflow: hidden;
}

.input-container:focus-within {
  border-color: var(--primary-color);
}

.input-container textarea {
  width: 100%;
  padding: 12px 16px;
  border: none;
  resize: none;
  outline: none;
  background-color: transparent;
  color: var(--text-color);
  font-family: inherit;
  font-size: 1rem;
  max-height: 150px;
  min-height: 24px;
  line-height: 1.5;
  overflow-y: hidden;
  transition: height 0.1s ease;
  position: relative;
  bottom: 0;
}

.input-container textarea::placeholder {
  color: var(--text-secondary);
}

/* 当文本区域达到最大高度时才显示滚动条 */
.input-container textarea.scrollable {
  overflow-y: auto;
}

/* 输入框底部按钮区域 */
.input-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
}

.input-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tool-button {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tool-button:hover {
  background-color: var(--button-hover);
}

/* 发送按钮样式 */
.send-button {
  background-color: #000000;
  color: white;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  transition: opacity 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dark-mode .send-button {
  background-color: #ffffff;
  color: #000000;
}

.send-button:hover {
  opacity: 0.7;
}

.send-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.send-button svg {
  width: 18px;
  height: 18px;
}

.input-footer {
  display: flex;
  justify-content: center;
  padding: 8px 4px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* 加载动画 */
.loading-animation {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 16px 0;
}

.loading-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--loading-dot-bg);
  animation: loading 1.2s infinite ease-in-out;
  opacity: 0.6;
}

.loading-dot:nth-child(1) {
  animation-delay: 0s;
}

.loading-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.loading-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes loading {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.6;
  }
  40% {
    transform: scale(1.2);
    opacity: 1;
  }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .app-header {
    padding: 12px 16px;
  }
  
  .app-title {
    font-size: 1.1rem;
  }
  
  .header-actions {
    gap: 8px;
  }
  
  .status-indicator span:not(.status-dot) {
    display: none;
  }
  
  .main-content {
    margin-top: 56px; /* 调整移动端下的顶部边距，对应更小的header */
  }
  
  .chat-container,
  .input-wrapper {
    width: 100%;
    max-width: 100%;
  }
  
  /* 在移动端隐藏回到底部按钮 */
  .scroll-to-bottom-btn {
    display: none !important;
  }
}

/* 动画效果 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 复制按钮样式 */
.copy-button {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.copy-button:hover {
  background-color: var(--button-hover);
}

/* Toast提示样式 */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 14px;
  z-index: 1000;
  animation: fadeInOut 2.3s ease;
  pointer-events: none;
}

.toast-success {
  background-color: #44aa44 !important;
}

.toast-error {
  background-color: #ff4444 !important;
}

.toast-warning {
  background-color: #ffaa00 !important;
}

.toast.hide {
  opacity: 0;
  transition: opacity 0.3s ease;
}

@keyframes fadeInOut {
  0% { opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { opacity: 0; }
}

/* 回到底部按钮 */
.scroll-to-bottom-btn {
  position: fixed;
  bottom: 90px; /* 位于输入框上方 */
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 10;
}

.scroll-to-bottom-btn.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-to-bottom-btn:hover {
  background-color: var(--primary-hover);
}

/* ===== 模态窗口样式 ===== */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: var(--bg-color);
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  animation: modalSlideIn 0.3s ease;
}

.modal-content.large {
  max-width: 800px;
  width: 95%;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  color: var(--text-color);
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
}

.modal-close:hover {
  background-color: var(--button-hover);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(80vh - 80px);
}

/* ===== 搜索和过滤器样式 ===== */
.search-input {
  background-color: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text-color);
  font-size: 14px;
  width: 100%;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.history-filters {
  margin-bottom: 20px;
}

.action-button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.action-button:hover {
  background-color: var(--primary-hover);
}

/* ===== 历史记录样式 ===== */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-item {
  background-color: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.history-item:hover {
  border-color: var(--primary-color);
  background-color: var(--button-hover);
}

.history-command {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 13px;
  color: var(--text-color);
  margin-bottom: 4px;
}

.history-meta {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history-actions {
  display: flex;
  gap: 8px;
}

.history-action {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  font-size: 12px;
}

.history-action:hover {
  background-color: var(--button-hover);
  color: var(--text-color);
}

/* 状态徽章样式 */
.status-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  margin-left: 6px;
}

.status-pending {
  background-color: #fef3c7;
  color: #92400e;
}

.status-processing {
  background-color: #dbeafe;
  color: #1d4ed8;
}

.status-completed {
  background-color: #d1fae5;
  color: #065f46;
}

.status-error {
  background-color: #fee2e2;
  color: #dc2626;
}

.has-results-badge {
  margin-left: 6px;
  font-size: 10px;
  opacity: 0.7;
}

.dark-mode .status-pending {
  background-color: #451a03;
  color: #fbbf24;
}

.dark-mode .status-processing {
  background-color: #1e3a8a;
  color: #60a5fa;
}

.dark-mode .status-completed {
  background-color: #064e3b;
  color: #34d399;
}

.dark-mode .status-error {
  background-color: #7f1d1d;
  color: #f87171;
}

/* ===== 收藏夹样式 ===== */
.favorites-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

.favorite-item {
  background-color: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.favorite-item:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.favorite-title {
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 8px;
  font-size: 14px;
}

.favorite-command {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  max-height: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.favorite-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.favorite-date {
  font-size: 11px;
  color: var(--text-secondary);
}

/* ===== 系统状态样式 ===== */
.status-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
}

.status-tab {
  background: none;
  border: none;
  padding: 12px 16px;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  font-size: 14px;
}

.status-tab.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.status-tab:hover {
  color: var(--text-color);
}

.status-tab-content {
  display: none;
}

.status-tab-content.active {
  display: block;
}

.status-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.status-card {
  background-color: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
}

.status-card h4 {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-value {
  color: var(--text-color);
  font-size: 24px;
  font-weight: 600;
}

.analytics-section, .queue-info, .system-metrics {
  margin-bottom: 24px;
}

.analytics-section h4 {
  color: var(--text-color);
  font-size: 16px;
  margin-bottom: 16px;
}

.queue-stats {
  display: flex;
  gap: 24px;
  margin-bottom: 16px;
  padding: 16px;
  background-color: var(--input-bg);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.queue-stats span {
  color: var(--text-secondary);
  font-size: 14px;
}

.queue-stats strong {
  color: var(--text-color);
}

.queue-list {
  max-height: 300px;
  overflow-y: auto;
}

.queue-item {
  background-color: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
}

.queue-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.queue-item-command {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 12px;
  color: var(--text-color);
}

.queue-item-status {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
}

.queue-item-status.pending {
  background-color: #fef3c7;
  color: #92400e;
}

.queue-item-status.processing {
  background-color: #dbeafe;
  color: #1e40af;
}

.queue-item-status.failed {
  background-color: #fee2e2;
  color: #dc2626;
}

.metric-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  padding: 12px;
  background-color: var(--input-bg);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.metric-row span:first-child {
  min-width: 120px;
  color: var(--text-secondary);
  font-size: 14px;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background-color: var(--border-color);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background-color: var(--primary-color);
  transition: width 0.3s ease;
}

/* 队列摘要样式 */
.queue-summary {
  background-color: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
}

.summary-item:last-child {
  border-bottom: none;
}

.summary-label {
  color: var(--text-secondary);
  font-size: 14px;
}

.summary-value {
  color: var(--text-color);
  font-weight: 600;
  font-size: 14px;
}

.empty-message {
  color: var(--text-secondary);
  font-style: italic;
  text-align: center;
  padding: 16px;
  background-color: var(--code-bg);
  border-radius: 6px;
  border: 1px dashed var(--border-color);
}

/* ===== 恢复和刷新按钮样式 ===== */
.recovery-button {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: none;
  transition: all 0.2s ease;
}

.recovery-button:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.refresh-button {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  border: none;
  transition: all 0.2s ease;
}

.refresh-button:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.dark-mode .recovery-button,
.dark-mode .refresh-button {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.dark-mode .recovery-button:hover {
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.dark-mode .refresh-button:hover {
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* ===== Supabase诊断相关样式 ===== */
.supabase-setup-guide,
.supabase-error,
.supabase-rpc-error {
  background: linear-gradient(135deg, #fee2e2 0%, #fef2f2 100%);
  border: 1px solid #fca5a5;
  border-radius: 12px;
  padding: 20px;
  margin: 16px 0;
  font-size: 14px;
  line-height: 1.6;
}

.dark-mode .supabase-setup-guide,
.dark-mode .supabase-error,
.dark-mode .supabase-rpc-error {
  background: linear-gradient(135deg, #2d1b1b 0%, #1e1717 100%);
  border-color: #dc2626;
  color: #fecaca;
}

.supabase-setup-guide h3,
.supabase-error h4,
.supabase-rpc-error h4 {
  color: #dc2626;
  margin-bottom: 12px;
  font-weight: 600;
}

.dark-mode .supabase-setup-guide h3,
.dark-mode .supabase-error h4,
.dark-mode .supabase-rpc-error h4 {
  color: #f87171;
}

.setup-steps h4,
.troubleshooting h5 {
  color: #374151;
  margin: 16px 0 8px 0;
  font-weight: 500;
}

.dark-mode .setup-steps h4,
.dark-mode .troubleshooting h5 {
  color: #d1d5db;
}

.setup-steps ul,
.troubleshooting ul,
.troubleshooting ol {
  margin: 8px 0 16px 20px;
}

.setup-steps li,
.troubleshooting li {
  margin: 4px 0;
}

.setup-steps pre {
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  padding: 12px;
  margin: 8px 0;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 13px;
  overflow-x: auto;
}

.dark-mode .setup-steps pre {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.setup-steps code {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 13px;
}

.dark-mode .setup-steps code {
  background: rgba(255, 255, 255, 0.1);
}

/* 错误消息样式增强 */
.message.error {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border-left: 4px solid #dc2626;
}

.dark-mode .message.error {
  background: linear-gradient(135deg, #1e1717 0%, #2d1b1b 100%);
  border-left-color: #f87171;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .supabase-setup-guide,
  .supabase-error,
  .supabase-rpc-error {
    padding: 16px;
    margin: 12px 0;
  }
  
  /* 修复移动端复制按钮样式 - 保持水平排列 */
  .action-buttons {
    flex-direction: row;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  
  /* 只对特定的按钮组使用垂直排列 */
  .action-buttons.vertical {
    flex-direction: column;
  }
  
  .action-buttons .btn {
    justify-content: center;
  }
  
  /* 复制按钮在移动端保持合适的大小 */
  .copy-button {
    min-width: 36px;
    min-height: 36px;
    padding: 8px;
  }
}

/* ===== 表单样式 ===== */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  color: var(--text-color);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background-color: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text-color);
  font-size: 14px;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

.cancel-button {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cancel-button:hover {
  background-color: var(--button-hover);
  color: var(--text-color);
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    max-height: 90vh;
  }
  
  .status-cards {
    grid-template-columns: 1fr;
  }
  
  .favorites-list {
    grid-template-columns: 1fr;
  }
  
  .queue-stats {
    flex-direction: column;
    gap: 8px;
  }
  
  .metric-row {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .metric-row span:first-child {
    min-width: auto;
  }
  
  .progress-bar {
    width: 100%;
  }
}

/* ===== 动画定义 ===== */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}